-
Notifications
You must be signed in to change notification settings - Fork 3
chore: Update grid API schemas from webdev #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Greptile OverviewGreptile SummaryThis PR auto-syncs the OpenAPI schema definitions for per-currency Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/GbpAccountInfo.yaml | Removes accountType enum and loosens sort code/account number validation (drops pattern/length/examples), which can break discriminator-based schema selection and allows invalid GBP routing data. |
| openapi/components/schemas/common/SgdAccountInfo.yaml | Schema update appears to remove accountType and SWIFT/BIC validation details (per diff review); likely breaks discriminator selection and allows invalid routing identifiers for SGD accounts. |
| openapi/components/schemas/common/PhpAccountInfo.yaml | Schema update appears to remove accountType (per diff review), which can break discriminator-based selection for PHP account variants. |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | Discriminator mapping update introduces duplicate/competing keys (e.g., CLABE vs CLABE_ACCOUNT), risking ambiguous validation/codegen depending on what accountType values clients send. |
| openapi/components/schemas/common/BrlAccountInfo.yaml | Auto-synced BRL account info schema; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/BrlBeneficiary.yaml | Auto-synced BRL beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/DkkAccountInfo.yaml | Auto-synced DKK account info schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/DkkBeneficiary.yaml | Auto-synced DKK beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/GbpBeneficiary.yaml | Auto-synced GBP beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/HkdAccountInfo.yaml | Auto-synced HKD account info schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/HkdBeneficiary.yaml | Auto-synced HKD beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/IdrAccountInfo.yaml | Auto-synced IDR account info schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/IdrBeneficiary.yaml | Auto-synced IDR beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/InrAccountInfo.yaml | Auto-synced INR account info schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/InrBeneficiary.yaml | Auto-synced INR beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/MxnAccountInfo.yaml | Auto-synced MXN account info schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/MxnBeneficiary.yaml | Auto-synced MXN beneficiary schema update; no obvious structural issues found from spot-check. |
| openapi/components/schemas/common/MyrAccountInfo.yaml | Auto-synced MYR account info schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/MyrBeneficiary.yaml | Auto-synced MYR beneficiary schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/PhpBeneficiary.yaml | Auto-synced PHP beneficiary schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/SgdBeneficiary.yaml | Auto-synced SGD beneficiary schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/ThbAccountInfo.yaml | Auto-synced THB account info schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/ThbBeneficiary.yaml | Auto-synced THB beneficiary schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/UsdAccountInfo.yaml | Auto-synced USD account info schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/UsdBeneficiary.yaml | Auto-synced USD beneficiary schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/VndAccountInfo.yaml | Auto-synced VND account info schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/common/VndBeneficiary.yaml | Auto-synced VND beneficiary schema; no obvious structural issues found during spot-check. |
| openapi/components/schemas/external_accounts/BrlAccountInfo.yaml | External BRL account schema updated to new allOf composition; verify discriminator accountType compatibility with ExternalAccountInfoOneOf. |
| openapi/components/schemas/external_accounts/CadAccountInfo.yaml | External CAD account schema updated; ensure it remains reachable via discriminator mapping and that required fields are preserved in composed common schema. |
| openapi/components/schemas/external_accounts/ClabeAccountInfo.yaml | New simplified CLABE account schema references BaseExternalAccountInfo + common ClabeAccountInfo; may omit beneficiary requirements present in *ExternalAccountInfo variants. |
| openapi/components/schemas/external_accounts/DkkAccountInfo.yaml | External DKK account schema updated; ensure discriminator mapping and composition align with prior ExternalAccountInfo variant behavior. |
| openapi/components/schemas/external_accounts/GbpAccountInfo.yaml | External GBP account schema updated; relies on common/GbpAccountInfo which now lacks accountType and validation patterns. |
| openapi/components/schemas/external_accounts/HkdAccountInfo.yaml | External HKD account schema updated; ensure discriminator mapping and composition align with prior behavior. |
| openapi/components/schemas/external_accounts/IbanAccountInfo.yaml | External IBAN account schema updated; ensure discriminator mapping doesn’t conflict with legacy IBAN key and that composed schema still enforces required IBAN fields. |
| openapi/components/schemas/external_accounts/IdrAccountInfo.yaml | External IDR account schema updated; ensure discriminator mapping and composition align with prior behavior. |
| openapi/components/schemas/external_accounts/InrAccountInfo.yaml | External INR account schema updated; ensure discriminator mapping and composition align with prior behavior. |
| openapi/components/schemas/external_accounts/MxnAccountInfo.yaml | External MXN account schema updated; ensure discriminator mapping and composition align with prior behavior. |
| openapi/components/schemas/external_accounts/MyrAccountInfo.yaml | External MYR account schema updated; ensure discriminator mapping and composition align with prior behavior. |
| openapi/components/schemas/external_accounts/NgnAccountInfo.yaml | External NGN account schema updated; ensure discriminator mapping and composition align with prior behavior. |
| openapi/components/schemas/external_accounts/PhpAccountInfo.yaml | External PHP account schema updated; relies on common/PhpAccountInfo which now lacks accountType. |
| openapi/components/schemas/external_accounts/PixAccountInfo.yaml | Adds PIX external account schema wrapper; in ExternalAccountInfoOneOf discriminator mapping, introduces additional PIX_ACCOUNT mapping alongside existing PIX mapping. |
| openapi/components/schemas/external_accounts/SgdAccountInfo.yaml | Adds SGD external account schema wrapper; depends on common/SgdAccountInfo which removed SWIFT/BIC and accountType enum constraints. |
| openapi/components/schemas/external_accounts/ThbAccountInfo.yaml | Introduces/updates THB external account schema wrapper (allOf composition). No obvious structural issues found. |
| openapi/components/schemas/external_accounts/UpiAccountInfo.yaml | Adds UPI external account schema wrapper; in ExternalAccountInfoOneOf discriminator mapping, introduces additional UPI_ACCOUNT mapping alongside existing UPI mapping. |
| openapi/components/schemas/external_accounts/UsAccountInfo.yaml | Introduces US account info wrapper (allOf composition). No obvious structural issues found. |
| openapi/components/schemas/external_accounts/UsdAccountInfo.yaml | Introduces/updates USD external account schema wrapper (allOf composition). No obvious structural issues found. |
| openapi/components/schemas/external_accounts/VndAccountInfo.yaml | Introduces/updates VND external account schema wrapper (allOf composition). No obvious structural issues found. |
Sequence Diagram
sequenceDiagram
participant Sparkcore as sparkcore (field defs)
participant Webdev as webdev schema generator
participant GridRepo as grid-api repo
participant OpenAPI as OpenAPI components/schemas
participant Client as client codegen/validators
Sparkcore->>Webdev: Define/adjust VASP adapter fields
Webdev->>Webdev: Generate YAML schemas per currency
Webdev->>GridRepo: Copybara sync (PR #180)
GridRepo->>OpenAPI: Update common/* and external_accounts/*
Client->>OpenAPI: Codegen / validation uses updated schemas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
47 files reviewed, 4 comments
| type: object | ||
| required: | ||
| - sortCode | ||
| - accountNumber | ||
| - accountType | ||
| - sortCode | ||
| - accountNumber | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - GBP_ACCOUNT | ||
| sortCode: | ||
| type: string | ||
| description: UK bank sort code (6 digits, may include hyphens) | ||
| example: '20-00-00' | ||
| pattern: '^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$' | ||
| description: The sort code of the bank | ||
| accountNumber: | ||
| type: string | ||
| description: UK bank account number (8 digits) | ||
| example: '12345678' | ||
| minLength: 8 | ||
| maxLength: 8 | ||
| pattern: ^[0-9]{8}$ | ||
| description: The account number of the bank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed discriminator field
common/GbpAccountInfo.yaml no longer defines the accountType property (and it was removed from required). Since ExternalAccountInfoOneOf.yaml uses accountType as the discriminator property, GBP account payloads can no longer reliably validate/resolve to the correct schema variant.
This also drops the sort code/account number constraints (pattern/length), so invalid routing values will now pass schema validation.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/GbpAccountInfo.yaml
Line: 1:11
Comment:
**Removed discriminator field**
`common/GbpAccountInfo.yaml` no longer defines the `accountType` property (and it was removed from `required`). Since `ExternalAccountInfoOneOf.yaml` uses `accountType` as the discriminator property, GBP account payloads can no longer reliably validate/resolve to the correct schema variant.
This also drops the sort code/account number constraints (pattern/length), so invalid routing values will now pass schema validation.
How can I resolve this? If you propose a fix, please make it concise.| type: object | ||
| required: | ||
| - bankName | ||
| - swiftCode | ||
| - accountNumber | ||
| - accountType | ||
| - bankName | ||
| - accountNumber | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - SGD_ACCOUNT | ||
| bankName: | ||
| type: string | ||
| description: Name of the beneficiary's bank | ||
| example: DBS Bank Ltd | ||
| swiftCode: | ||
| type: string | ||
| description: SWIFT/BIC code (8 or 11 characters) | ||
| example: DBSSSGSG | ||
| minLength: 8 | ||
| maxLength: 11 | ||
| pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ | ||
| description: The bank name of the bank | ||
| accountNumber: | ||
| type: string | ||
| description: Bank account number | ||
| example: '0123456789' | ||
| description: The account number of the bank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped required routing fields
common/SgdAccountInfo.yaml removes both the accountType enum and the swiftCode field from required/properties. With ExternalAccountInfoOneOf.yaml discriminating on accountType, this breaks schema resolution for SGD accounts, and the removal of swiftCode (and its length/pattern constraints) means wire-transfer routing data for SGD accounts is no longer validated by the schema.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/SgdAccountInfo.yaml
Line: 1:11
Comment:
**Dropped required routing fields**
`common/SgdAccountInfo.yaml` removes both the `accountType` enum and the `swiftCode` field from `required`/`properties`. With `ExternalAccountInfoOneOf.yaml` discriminating on `accountType`, this breaks schema resolution for SGD accounts, and the removal of `swiftCode` (and its length/pattern constraints) means wire-transfer routing data for SGD accounts is no longer validated by the schema.
How can I resolve this? If you propose a fix, please make it concise.| type: object | ||
| required: | ||
| - bankName | ||
| - accountNumber | ||
| - accountType | ||
| - bankName | ||
| - accountNumber | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - PHP_ACCOUNT | ||
| bankName: | ||
| type: string | ||
| description: Name of the beneficiary's bank | ||
| example: BDO Unibank | ||
| description: The bank name of the bank | ||
| accountNumber: | ||
| type: string | ||
| description: Bank account number | ||
| example: '001234567890' | ||
| description: The account number of the bank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing discriminator field
common/PhpAccountInfo.yaml removes the accountType enum property (and it was removed from required). Because ExternalAccountInfoOneOf.yaml uses accountType as the discriminator, PHP account payloads can’t be reliably validated/resolved to the intended schema variant anymore.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/PhpAccountInfo.yaml
Line: 1:11
Comment:
**Missing discriminator field**
`common/PhpAccountInfo.yaml` removes the `accountType` enum property (and it was removed from `required`). Because `ExternalAccountInfoOneOf.yaml` uses `accountType` as the discriminator, PHP account payloads can’t be reliably validated/resolved to the intended schema variant anymore.
How can I resolve this? If you propose a fix, please make it concise.| oneOf: | ||
| - title: US Account | ||
| $ref: ./UsAccountExternalAccountInfo.yaml | ||
| - title: CLABE Account | ||
| $ref: ./ClabeAccountExternalAccountInfo.yaml | ||
| - title: PIX Account | ||
| $ref: ./PixAccountExternalAccountInfo.yaml | ||
| - title: IBAN Account | ||
| $ref: ./IbanAccountExternalAccountInfo.yaml | ||
| - title: UPI Account | ||
| $ref: ./UpiAccountExternalAccountInfo.yaml | ||
| - title: NGN Account | ||
| $ref: ./NgnAccountExternalAccountInfo.yaml | ||
| - title: CAD Account | ||
| $ref: ./CadAccountExternalAccountInfo.yaml | ||
| - title: GBP Account | ||
| $ref: ./GbpAccountExternalAccountInfo.yaml | ||
| - title: PHP Account | ||
| $ref: ./PhpAccountExternalAccountInfo.yaml | ||
| - title: SGD Account | ||
| $ref: ./SgdAccountExternalAccountInfo.yaml | ||
| - title: Spark Wallet | ||
| $ref: ./SparkWalletExternalAccountInfo.yaml | ||
| - title: Lightning | ||
| $ref: ./LightningExternalAccountInfo.yaml | ||
| - title: Solana Wallet | ||
| $ref: ./SolanaWalletExternalAccountInfo.yaml | ||
| - title: Tron Wallet | ||
| $ref: ./TronWalletExternalAccountInfo.yaml | ||
| - title: Polygon Wallet | ||
| $ref: ./PolygonWalletExternalAccountInfo.yaml | ||
| - title: Base Wallet | ||
| $ref: ./BaseWalletExternalAccountInfo.yaml | ||
| - title: US Account | ||
| $ref: ./UsAccountExternalAccountInfo.yaml | ||
| - title: CLABE Account | ||
| $ref: ./ClabeAccountExternalAccountInfo.yaml | ||
| - title: PIX Account | ||
| $ref: ./PixAccountExternalAccountInfo.yaml | ||
| - title: IBAN Account | ||
| $ref: ./IbanAccountExternalAccountInfo.yaml | ||
| - title: UPI Account | ||
| $ref: ./UpiAccountExternalAccountInfo.yaml | ||
| - title: NGN Account | ||
| $ref: ./NgnAccountExternalAccountInfo.yaml | ||
| - title: CAD Account | ||
| $ref: ./CadAccountExternalAccountInfo.yaml | ||
| - title: GBP Account | ||
| $ref: ./GbpAccountExternalAccountInfo.yaml | ||
| - title: PHP Account | ||
| $ref: ./PhpAccountExternalAccountInfo.yaml | ||
| - title: SGD Account |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conflicting discriminator values
ExternalAccountInfoOneOf.yaml now includes new *_ACCOUNT mappings (e.g. CLABE_ACCOUNT, PIX_ACCOUNT, IBAN_ACCOUNT, UPI_ACCOUNT) while keeping the old values (CLABE, PIX, IBAN, UPI) mapped to the existing *ExternalAccountInfo.yaml schemas.
If clients send different accountType values for the same conceptual account type, they’ll validate against different schemas (some include beneficiary via *ExternalAccountInfo.yaml, while the new *AccountInfo.yaml wrappers do not). This creates inconsistent API validation/codegen behavior and should be normalized to a single discriminator value per variant.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 1:20
Comment:
**Conflicting discriminator values**
`ExternalAccountInfoOneOf.yaml` now includes new `*_ACCOUNT` mappings (e.g. `CLABE_ACCOUNT`, `PIX_ACCOUNT`, `IBAN_ACCOUNT`, `UPI_ACCOUNT`) while keeping the old values (`CLABE`, `PIX`, `IBAN`, `UPI`) mapped to the existing `*ExternalAccountInfo.yaml` schemas.
If clients send different `accountType` values for the same conceptual account type, they’ll validate against different schemas (some include `beneficiary` via `*ExternalAccountInfo.yaml`, while the new `*AccountInfo.yaml` wrappers do not). This creates inconsistent API validation/codegen behavior and should be normalized to a single discriminator value per variant.
How can I resolve this? If you propose a fix, please make it concise.
Auto-synced grid API schemas from webdev.
These schemas are generated from VASP adapter field definitions in sparkcore.
Synced directories:
common/— per-currency account info and beneficiary schemasexternal_accounts/— per-currency external account schemas (reference common/)Please review the changes before merging.